package kr.hkit.androidcomplete02.ch12;

import java.util.ArrayList;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListViewArrayList extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch12_listviewarraylist);

		ArrayList<String> arGeneral = new ArrayList<>();
		arGeneral.add("김유신");
		arGeneral.add("이순신");
		arGeneral.add("강감찬");
		arGeneral.add("을지문덕");

		ArrayAdapter<String> aAdapter = new ArrayAdapter<>(this,
				android.R.layout.simple_list_item_1, arGeneral);
		
		ListView list = (ListView) findViewById(R.id.ch12_listView);
		list.setAdapter(aAdapter);
		
	}
}
